Welcome to the BAMBOO API
The following is API documentation for the Bamboo System.
Contents
Products
Preferences
Product TEPlate
Description: Folder and file formats for a TEPlate.
Folder Structure
All products are stored in the /~user/Bamboo/Products/ folder. Each Product has its own unque folder name in the following format:
productname-productid
Where productname is the name of the product (alpha-numeric only) and the productid is a 32 character unique code for this product.
It should be unique across every product created -
based upon mac address of computer and time that it was created. Inside of each product folder, there is:
productname-productid/teplate.xml
productname-productid/assets/
productname-productid/fonts/
The teplate.xml file specifies all of the parameters of the teplate, discussed in more detail below.
The /assets/ folder will contain all image assets referenced by the teplate.xml file.
The /fonts/ folder will contain all of the available fonts for that product.
TEPlate.xml File Format
The main components of the TEPlate.xml file are:
<?xml version="1.0" ?>
<data>
<plucode>ABCD1234</plucode>
<productid>DHN34EUC2HDG3650L58O89YJB5GAFSR</productid>
<name>NAME OF PRODUCT</name>
<price>
...
</price>
<landscape>
...
</landscape>
<portrait>
...
</portrait>
<icon>icon.png</icon>
</data>
The plucode is the PLU code used for that product. This can be a non-unique field.
The productid is a 32 character code that is unique for this product, and should be
generating using the mac address of the creating computer and the time that it was created. The name
field is the display name of the product that is shown in Bamboo / TEPS. The icon field
is a path to the graphic file within the asset folder that is used for the icon of the product. The graphic assets is placed in the assets folder.
The price field will include one or more price fields corresponding to a minimum quantity ordered.
<price>
<quantity start="1">12.95</quantity>
<quantity start="2">7.05</quantity>
<quantity start="3">7.00</quantity>
</price>
When determining a price, the system uses the prices set in the quantity field,
using the start value as the minimum quantity that the pricing applies to. Using the example above,
if just quantity 1 is ordered, then it would look for
<quantity start="1"...
And use $12.05 as the value. If the quantity ordered is 4, the it uses start="1"
for 1 @ $12.95, start="2" for 1 @ $7.05, and start="3"
for 2 @ $7.00. In other words, it multiplies the price specified in quantity
for the quanity ordered from start to start-1 of the
next quantity if any.
The landscape and portrait fields include the same subfields,
and both are optional. If there are no landscape and no portrait fields,
then no image is generated, processed, or printed, and just an icon is ordered. This will be more important when a shopping
cart is incorporated into Bamboo.
If both landscape and portrait fields are used, the system matches
the aspect ratio of the selected image. Multiple landscape or multiple portrait
fields should be avoided, as the system will pick just one and there could be unknown results.
If just landscape or portrait is used, then that data will be used r
egardless of the aspect ratio of a selected image.
The landscape and portrait must specify a width,
height and at least one layer. The width
and height specify the pixel resolution of the width and height of the printed image, respectively.
<landscape>
<width>600</width>
<height>400</height>
<layer type="graphic" zindex="1">
<filename>background.jpg</filename>
<startx>0</startx>
<starty>0</starty>
<width>600</width>
<height>400</height>
</layer>
<layer type="image" zindex="2">
<startx>0</startx>
<starty>0</starty>
<width>600</width>
<height>400</height>
</layer>
<layer type="textbox" zindex="3">
<startx>100</startx>
<starty>200</starty>
<width>100</width>
<height>100</height>
<overflowx>false</overflowx>
<overflowy>true</overflowy>
<color optional="false">#000000</color>
<textshadow optional="false" posx="1" posy="1" blur="0">#FFFFFF</textshadow>
</layer>
</landscape>
Each layer has a type and zindex attribute.
The zindex should be unique for each layer of that orientation.
The type attribute
can be graphic, image or textbox. A graphic is a preset
image layer, such as a background or foreground. An image layer adds the selected image. The textbox adds a textbox area using one of the fonts in the fonts folder.
Each layer should specify a startx, starty, width and height,
which dictate the start position (upper left) size of the bounding box for that layer, relative to the width
and height specified in the parent landscape or portrait
field.
Images or graphics are cropped and resized to fill the entire layer.
For the graphic field, the filename field specifies the image path within the assets folder.
The textbox can also have optional overflowx, overflowy, color
and textshadow fields. The overflowx and overflowy fields specify whether the
text can flow outside of the width and height bound box specified in the layer. The color
and textshadow fields specify the color of the text and the text shadow, respectively. If the optional attribute
is present and set to true, then the color can be changed by the user. The posx and posy specify
the offset of the text shadow, while blur sets the blur.
As stated above, the portrait field has the same structure as landscape.
Prints
Description: Folder and file formats for Bamboo submitting a print request.
Folder Structure
All print files (requests) are saved in the /~user/Bamboo/Prints/ folder. Each Print has its own unque id, and is saved as [print unique id].xml;
Sample Print XML File
<?xml version="1.0" encoding="UTF-8"?>
<data>
<printid>1411758511601N32SGNQG</printid>
<imagepath>20140708/0000_IMG_8723.JPG</imagepath>
<plucode>14x6print</plucode>
<quantity>1</quantity>
<text>This is the Sample Text</text>
<textlayerzindex>3</textlayerzindex>
</data>
Currently, only one text layer is permitted per print job. The textlayerzindex corresponds
to the z-index attribute of the corresponding layer with type="textbox"
Receipt
Description: Folder and file formats for Bamboo generating a receipt.
Folder Structure
All receipts are saved in the /~user/Bamboo/Prints/ folder. Each Order has its own unque id, and is saved as [print unique id]_receipt.xml;
Sample Receipt XML File
other comments
Get Prefs
Coming Soon!